#include<bits/stdc++.h>
using namespace std;
#define N 40000
int a[N];
int main()
{
    int n,t;
    while(cin >> n >> t)
    {
        for(int i = 1; i < n; i ++)
        {
            cin >> a[i];
        }
        int index = 1;
        while(1)
        {
            index = index + a[index];
            if(index == t)
            {
                cout << "YES" << endl;
                break;
            }
            if(index > t)
            {
                cout << "NO" << endl;
                break;

            }

        }
    }
    return 0;

}
